import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';

export default defineConfig({
	plugins: [sveltekit()],
	server: {
		proxy: {
			'/api': {
				target: 'https://yuntuops.bjttsx.com',
				changeOrigin: true,
				// rewrite: (path) => path.replace(/^\/api/, '') // 可选，重写路径
			}
		}
	},
	css: {
		preprocessorOptions: {
			sass: {
				api: 'modern',
				additionalData: `@use '$lib/variables' as *;`,
			},
			scss: {
				api: 'modern',
				additionalData: `@use '$lib/variables' as *;`,
			}
		},
	}
});
